package com.fy.pojo.enums;

import lombok.Getter;

/**
 * 客服状态枚举
 */
@Getter
public enum CustomerServiceStatusEnum {
    
    OFFLINE(0, "离线"),
    ONLINE(1, "在线"),
    BUSY(2, "忙碌");
    
    /**
     * 状态值
     */
    private final Integer value;
    
    /**
     * 状态描述
     */
    private final String text;
    
    CustomerServiceStatusEnum(Integer value, String text) {
        this.value = value;
        this.text = text;
    }
    
    /**
     * 根据 value 获取枚举值
     */
    public static CustomerServiceStatusEnum getEnumByValue(Integer value) {
        if (value == null) {
            return null;
        }
        for (CustomerServiceStatusEnum anEnum : CustomerServiceStatusEnum.values()) {
            if (anEnum.value.equals(value)) {
                return anEnum;
            }
        }
        return null;
    }
}